package com.pdg.dungeondelver.client;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import com.pdg.dungeondelver.configuration.Configuration;
import com.pdg.dungeondelver.configuration.ConfigurationLoadException;
import com.pdg.dungeondelver.engine.Atlas;

public class Client extends StateBasedGame{

	private static final String XFG_CONFIG_XML = "cfg/config.xml";
	
	private Atlas atlas;
	public void setAtlas(Atlas theAtlas){
		atlas = theAtlas;
	}
	public Atlas getAtlas(){
		return atlas;
	}

	public Client(String title) {
		super(title);
	}

	@Override
	public void initStatesList(GameContainer gc) throws SlickException {
		try {
			Configuration configuration = new Configuration(XFG_CONFIG_XML);
			addState(new SplashState(configuration,this,States.SPLASH));
			addState(new MainMenuState(configuration,this,States.MAINMENU));
			addState(new PlayState(configuration,this,States.PLAY));
		} catch (ConfigurationLoadException e) {
			e.printStackTrace();
			gc.setForceExit(true);
		}
	}

}
